#include <stdio.h>

/**
 * 在声明中初始化字符串
 */
int main() {
	// 一个指针变量可以指向一个字符穿常量的位置
	char *aa = "We can use a pointer to a string constant.";
	// 使用字符数组初始化
	char bb[] = "We can also use an array";
	// 指针数组
	char *cc[] = {"We can", "use and array", "of pointers to a constant."};
	// 二维数组
	char dd[][11] = {"Or we can", "use a 2-D", "array"};

	printf("Addresses: \n"
		   "\taa = %p \n"
		   "\tcc[0] = %p \n"
		   "\tcc[1] = %p \n"
		   "\tcc[2] = %p \n"
		   "\tbb = %p \n"
		   "\tdd[0] = %p \n"
		   "\tdd[1] = %p \n"
		   "\tdd[2] = %p \n", aa, cc[0], cc[1], cc[2],
		   bb, dd[0], dd[1], dd[2]);

	puts(aa);
	puts(bb);

	for (int i = 0; i < 3; i++) {
		puts(cc[i]);
	}
	putchar('\n');
	for (int i = 0; i < 3; i++) {
		puts(dd[i]);
	}

}